#pragma once
#include "Hash_bucket.h"


namespace bit
{
	template<class K,class V>
	class unordered_map
	{
		struct _mapKeyOfT
		{
			const K& operator()(const pair<K, V>& kv)
			{
				return kv.first;
			}
		};
	public:
		typedef typename hash_bucket::Hashtable<K, pair<K,V>, _mapKeyOfT>::iterator iterator;
		iterator begin()
		{
			return _ht.begin();
		}

		iterator end()
		{
			return _ht.end();
		}

		bool insert(const pair<K,V>& kv)
		{
			return _ht.Insert(kv);
		}
	private:
		hash_bucket::Hashtable<K, pair<K, V>, _mapKeyOfT> _ht;
	};
}


